package com.ca.ui.core.view.bar;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;

import com.ca.ui.core.R;

public class SearchBar extends ConstraintLayout {

    public ImageView backView;
    public EditText input;
    public ImageView searchView;

    public SearchBar(@NonNull Context context) {
        super(context);
        initView(context);
    }

    public SearchBar(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initView(context);
    }

    public SearchBar(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context);
    }

    private void initView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.search_bar_layout, this);
        backView = view.findViewById(R.id.iv_back);
        input = view.findViewById(R.id.input);
        searchView = view.findViewById(R.id.iv_search);
    }
}
